

<%@ page import="martial.arts.tracker.Attendance" %>
<%@ page import="martial.arts.tracker.Student" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'attendance.label', default: 'Attendance')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
        <g:javascript plugin="prototype" library="scriptaculous"/>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${attendanceInstance}">
            <div class="errors">
                <g:renderErrors bean="${attendanceInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="maClass"><g:message code="attendance.maClass.label" default="Class" /></label>
                                    <g:select name="maClass.id" from="${martial.arts.tracker.MaClass.list()}" optionKey="id" value="${attendanceInstance?.maClass?.id}"  />
                                </td>
                                <!--td valign="top" class="value ${hasErrors(bean: attendanceInstance, field: 'maClass', 'errors')}">
                                    <g:select name="maClass.id" from="${martial.arts.tracker.MaClass.list()}" optionKey="id" value="${attendanceInstance?.maClass?.id}"  />
                                </td-->
                            </tr>
                        
                            <!--tr class="prop">
                                <td valign="top" class="name">
                                    <label for="student"><g:message code="attendance.student.label" default="Student" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: attendanceInstance, field: 'student', 'errors')}">
                                    <g:select name="student.id" from="${martial.arts.tracker.Student.list()}" optionKey="id" value="${attendanceInstance?.student?.id}"  />
                                </td>
                            </tr-->

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label><h3>Checkin Search</h3></label>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label>Student Id: </label>
                                    <g:textField name="studentId"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label>Last Name: </label>
                                    <g:textField name="lastName"/>
                                </td>
                            </tr>

                            <!--tr class="prop">
                                <td valign="top" class="name">
                                    <g:actionSubmit value="Student Search" action="search" />
                                </td>
                            </tr-->

                            <tr class="prop">
                                <td valign="top" class="button">
                                    <g:submitToRemote action="search" value="Student Search" update="student.search.results"/>
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                    <div id="student.search.results" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
